package com.financialsharing.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 用户类
 */
//属性为空或者NULL都不序列化
public class User {
    /**
     * 主键id
     */
    @ExcelProperty("用户id")
    private Integer id;
    /**
     * 用户名
     */
    @ExcelProperty("用户名")
    private String username;
    /**
     * 登录名
     */
    @ExcelProperty("登录名")
    private String loginName;
    /**
     * 登陆密码
     */
    @ExcelProperty("登录密码")
    private String password;
    /**
     * 邮箱
     */
    @ExcelProperty("邮箱")
    private String email;
    /**
     * 角色 复合类型
     */
    @ExcelIgnore
    private Role role;
    /**
     * 角色id
     */
    @ExcelProperty("角色id")
    private Integer roleId;
    /**
     * 创建时间
     */
    @ExcelIgnore
    private Date createTime;
    /**
     * 更新时间
     */
    @ExcelIgnore
    private Date updateTime;
    /**
     * 学校
     */
    @ExcelProperty("学校")
    private String school;
    /**
     * 省份
     */
    @ExcelProperty("省份")
    private String province;
    /**
     * 城市
     */
    @ExcelProperty("城市")
    private String city;
    /**
     * 城市
     */


    /**
     * 所在地
     */
    @ExcelIgnore
    private String address;
    /**
     * 班级
     */
    @ExcelIgnore
    private String classes;

    //access_token ilab平台操作唯一识别码
    @ExcelIgnore
    private String accessToken;

    public User(Integer id, String username, String loginName, String password, String email, Role role, Integer roleId, Date createTime, Date updateTime, String school, String province, String city, String address, String classes, String accessToken) {
        this.id = id;
        this.username = username;
        this.loginName = loginName;
        this.password = password;
        this.email = email;
        this.role = role;
        this.roleId = roleId;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.school = school;
        this.province = province;
        this.city = city;
        this.address = address;
        this.classes = classes;
        this.accessToken = accessToken;
    }

    public User() {
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


    public String getClasses() {
        return classes;
    }

    public void setClasses(String classes) {
        this.classes = classes;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", role=" + role +
                ", roleId=" + roleId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", school='" + school + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", address='" + address + '\'' +
                ", classes='" + classes + '\'' +
                '}';
    }
}
